// components/electronic-signature/electronic-signature.js
import imClient from '../../utils/im-client'
Component({
  options: {
    addGlobalClass: true,
  },
  /**
   * 组件的属性列表
   */
  properties: {
    show: { // 属性名
      type: Boolean,
      value: false
    },
    seatId: { // 属性名
      type: String,
      value: 'null'
    },
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    closeHandle(){
      this.triggerEvent('updateData', {signWindow:false})
      imClient.sendCustomMessage({
        id: this.data.seatId,
        description: 'ElectronicSignature',
        data:JSON.stringify({status:'cancal'})
      })
    },
    submit(){
      imClient.sendCustomMessage({
        id: this.data.seatId,
        description: 'ElectronicSignature',
        data:JSON.stringify({status:'success'})
      })
      this.triggerEvent('updateData', {signWindow:false})
    }
  }
})
